package com.biz.primus.app.erpbridge.feign;

import com.biz.primus.model.geo.enums.GeoLevel;
import com.biz.primus.model.geo.vo.SimpleCityVo;
import com.biz.primus.model.geo.vo.SimpleDistrictVo;
import com.biz.primus.model.geo.vo.SimpleProvinceVo;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * GeoFeignClient
 *
 * @author JKLiues
 * @date 2017年11月17日
 */
@FeignClient(qualifier = "geoFeignClient", name = "service-geo")
public interface GeoFeignClient {
    /**
     * 全省
     *
     * @return List<SimpleProvinceVo>
     */
    @GetMapping("soa/geoService/buildPushProvince")
    List<SimpleProvinceVo> buildPushProvince();

    /**
     * 全市
     *
     * @return List<SimpleCityVo>
     */
    @GetMapping("soa/geoService/buildPushCity")
    List<SimpleCityVo> buildPushCity();

    /**
     * 全区
     *
     * @return List<SimpleDistrictVo>
     */
    @GetMapping("soa/geoService/buildPushDistrict")
    List<SimpleDistrictVo> buildPushDistrict();

    /**
     * 记录推送日志
     *
     * @param size       推送数量
     * @param level      数据等级
     * @param returnCode 返回code
     */
    @PostMapping("soa/geoService/doPushLog")
    void doPushLog(@ApiParam("推送数量") @RequestParam("size") Integer size,
                   @ApiParam("数据等级") @RequestParam("level") GeoLevel level,
                   @ApiParam("返回code") @RequestParam("returnCode") Integer returnCode);
}